package com.example.demo1;

public class DemoTest {

    public static void main(String[] args) {

        Handler handler = new HandlerA();

        Handler handlerB = new HandlerB();
        handler.setSuccessor(handlerB);
        Handler handlerC = new HandlerC();
        handlerB.setSuccessor(handlerC);


        handler.handle("ABCD");

    }

}
